﻿using System;
using System.Security;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace SharePoint.UserAccountControl.Tests
{
    [TestClass]
    public class SharePointAccessTest
    {
        [TestMethod]
        public void CheckFarm_test()
        {
            var access = new SharePointAccess();
            var result = access.CheckFarm("contoso\\hilpalm");

            foreach (var accessInfo in result)
            {
                Console.WriteLine(accessInfo.Description);
            }
        }

        [TestMethod]
        [ExpectedException(typeof(SecurityException))]
        public void CheckFarm_throws_exception_when_account_name_is_invalid()
        {
            var access = new SharePointAccess();
            access.CheckFarm("unittest\\invalid");
 
        }
    }
}
